package com.blink.dao.mapper.ser;

import com.blink.model.entity.User;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * @author liuzh
 * @ClassName: UserSerMapper
 * @Description: 用户查询mapper
 * @date 2017年07月16日 20:11
 */
public class UserSerMapper {
    private static Map<String, User> userMap = null;

    public static User queryByUserId(String userId) {
        if (userMap == null) {
            initMap();
        }
        return userMap.get(userId);
    }

    private static void initMap() {
        userMap = Maps.newConcurrentMap();
        for (int i = 0; i < 10; i++) {
            userMap.put(i + "", User.create(i + "", "liuahxau" + i, i + 10, "male"));
        }
    }
}
